#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <DHT.h>
 
//定义引脚 D2
#define DHTPIN 2
//定义类型DHT11
#define DHTTYPE DHT11
//进行初始设置 
DHT dht(DHTPIN, DHTTYPE);
Adafruit_BMP085 bmp;//IIC  SCL->A4 SDA->A5
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  bmp.begin();
  dht.begin(); //DHT开始工作
}

void loop() {
  // put your main code here, to run repeatedly:
  float h = dht.readHumidity();//读湿度
  float t = dht.readTemperature();//读温度，默认为摄氏度
  Serial.print(t);
  Serial.print(",");
  Serial.print(h);
  Serial.print(",");
  Serial.println(bmp.readPressure());
  delay(1000);
}
